package cn.lanqiao.system.service.impl;

import cn.lanqiao.common.entity.Comment;
import cn.lanqiao.common.vo.CommentVo;
import cn.lanqiao.system.mapper.CommentMapper;
import cn.lanqiao.system.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
@Repository
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentMapper commentMapper;

    //查看所有评论
    @Override
    public List<CommentVo> showAllComment(Integer id) {
        return commentMapper.showAllComment(id);
    }

    @Override
    public Integer addComemnt(Comment comment) {
        return this.commentMapper.addComemnt(comment);
    }

    @Override
    public int deleteComemnt(Comment comment) {
        return this.commentMapper.deleteComemnt(comment);
    }

    @Override
    public int userAddComment(Comment comment) {

        return commentMapper.insertSelective(comment);
    }

}
